package com.tm.d7_enum;
/**
 * 2024/5/22 Cjj 枚举类B 15：02
 */
public enum B {
    X() {
        @Override
        public void go() {

        }
    },Y("肥") {
        @Override
        public void go() {
        System.out.println(getName()+"睡觉");
        }
    };
    private String name;

    B(){

    }
    B(String name){
        this.name=name;
    }

    public abstract void go();

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }
}
